package com.hlhj.funlike_business.presenter;

import android.content.Context;

import com.example.mymvp.mvp.BasePresenter;
import com.hlhj.funlike_business.bean.FoodListBean;
import com.hlhj.funlike_business.moudle.FoodFragmentMoudle;
import com.hlhj.funlike_business.views.FoodFragmentView;

import java.util.List;

public class FoodFragmentPresenter extends BasePresenter<FoodFragmentMoudle,FoodFragmentView> implements FoodFragmentMoudle.getFoodList {
    @Override
    public void createModule() {
        module=new FoodFragmentMoudle();
        module.setListener(this);
    }

    public void LoadFoodList(Context context,int type_id,int p,int num){
        module.LoadFoodList(context,type_id,p,num);
    }

    public void LoadFoodStatus(Context context,int id,int status){
        module.LoadFoodStatus(context,id,status);
    }

    @Override
    public void loadFoodList(List<FoodListBean.DataBeanX.DataBean> dataBeans) {
        getView().showFoodList(dataBeans);
    }

    @Override
    public void loadFoodStatus(String msg) {
        getView().showFoodStatusFood(msg);
    }
}
